package com.kaishengit.pojo;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="t_task")
//@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Task {
	private String taskid;
	private String task;
	private String starttime;
	private String endtime;
	//private String taskType;
	private String type;
	private TaskType tasktype;
	private User user;
	@Id
	@GenericGenerator(name="pk",strategy="uuid")
	@GeneratedValue(generator="pk")
	public String getTaskid() {
		return taskid;
	}
	public void setTaskid(String taskid) {
		this.taskid = taskid;
	}
	public String getTask() {
		return task;
	}
	public void setTask(String task) {
		this.task = task;
	}
	public String getStarttime() {
		return starttime;
	}
	public void setStarttime(String starttime) {
		this.starttime = starttime;
	}
	public String getEndtime() {
		return endtime;
	}
	public void setEndtime(String endtime) {
		this.endtime = endtime;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	
	@ManyToOne(fetch=FetchType.EAGER,cascade={CascadeType.REMOVE})
	@JoinColumn(name="tasktypeid")
	public TaskType getTasktype() {
		return tasktype;
	}
	public void setTasktype(TaskType tasktype) {
		this.tasktype = tasktype;
	}
	@ManyToOne(fetch=FetchType.EAGER,cascade={CascadeType.REMOVE})
	@JoinColumn(name="userid")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
	
	
	

}
